package com.longxi.tianjintianbao.greedao.dao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.longxi.tianjintianbao.greedao.entity.Inventory;
import com.longxi.tianjintianbao.greedao.entity.InventoryChild;
import com.longxi.tianjintianbao.greedao.entity.Patrol;
import com.longxi.tianjintianbao.greedao.entity.PatrolContent;
import com.longxi.tianjintianbao.greedao.entity.User;
import com.longxi.tianjintianbao.greedao.entity.Work;

import com.longxi.tianjintianbao.greedao.dao.InventoryDao;
import com.longxi.tianjintianbao.greedao.dao.InventoryChildDao;
import com.longxi.tianjintianbao.greedao.dao.PatrolDao;
import com.longxi.tianjintianbao.greedao.dao.PatrolContentDao;
import com.longxi.tianjintianbao.greedao.dao.UserDao;
import com.longxi.tianjintianbao.greedao.dao.WorkDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig inventoryDaoConfig;
    private final DaoConfig inventoryChildDaoConfig;
    private final DaoConfig patrolDaoConfig;
    private final DaoConfig patrolContentDaoConfig;
    private final DaoConfig userDaoConfig;
    private final DaoConfig workDaoConfig;

    private final InventoryDao inventoryDao;
    private final InventoryChildDao inventoryChildDao;
    private final PatrolDao patrolDao;
    private final PatrolContentDao patrolContentDao;
    private final UserDao userDao;
    private final WorkDao workDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        inventoryDaoConfig = daoConfigMap.get(InventoryDao.class).clone();
        inventoryDaoConfig.initIdentityScope(type);

        inventoryChildDaoConfig = daoConfigMap.get(InventoryChildDao.class).clone();
        inventoryChildDaoConfig.initIdentityScope(type);

        patrolDaoConfig = daoConfigMap.get(PatrolDao.class).clone();
        patrolDaoConfig.initIdentityScope(type);

        patrolContentDaoConfig = daoConfigMap.get(PatrolContentDao.class).clone();
        patrolContentDaoConfig.initIdentityScope(type);

        userDaoConfig = daoConfigMap.get(UserDao.class).clone();
        userDaoConfig.initIdentityScope(type);

        workDaoConfig = daoConfigMap.get(WorkDao.class).clone();
        workDaoConfig.initIdentityScope(type);

        inventoryDao = new InventoryDao(inventoryDaoConfig, this);
        inventoryChildDao = new InventoryChildDao(inventoryChildDaoConfig, this);
        patrolDao = new PatrolDao(patrolDaoConfig, this);
        patrolContentDao = new PatrolContentDao(patrolContentDaoConfig, this);
        userDao = new UserDao(userDaoConfig, this);
        workDao = new WorkDao(workDaoConfig, this);

        registerDao(Inventory.class, inventoryDao);
        registerDao(InventoryChild.class, inventoryChildDao);
        registerDao(Patrol.class, patrolDao);
        registerDao(PatrolContent.class, patrolContentDao);
        registerDao(User.class, userDao);
        registerDao(Work.class, workDao);
    }
    
    public void clear() {
        inventoryDaoConfig.clearIdentityScope();
        inventoryChildDaoConfig.clearIdentityScope();
        patrolDaoConfig.clearIdentityScope();
        patrolContentDaoConfig.clearIdentityScope();
        userDaoConfig.clearIdentityScope();
        workDaoConfig.clearIdentityScope();
    }

    public InventoryDao getInventoryDao() {
        return inventoryDao;
    }

    public InventoryChildDao getInventoryChildDao() {
        return inventoryChildDao;
    }

    public PatrolDao getPatrolDao() {
        return patrolDao;
    }

    public PatrolContentDao getPatrolContentDao() {
        return patrolContentDao;
    }

    public UserDao getUserDao() {
        return userDao;
    }

    public WorkDao getWorkDao() {
        return workDao;
    }

}
